<?php
namespace Club\Model;
use Think\Model;
class ContractOrderModel extends Model {
    /**
     * model的中文名称
     */
    public $modelName = '补充合同';

    /**
     * model的icon
     */
    public $modelIcon = 'icon-file';
    
    protected $_auto = [
        ["buyer_contract_time", "strtotime", 3, "function"],
        ["seller_contract_time", "strtotime", 3, "function"],
        ["create_time", "strtotime", 3, "function"],
        ["update_time", "strtotime", 3, "function"],
        ["create_time", "time", 1, "function"],
        ["update_time", "time", 2, "function"],
    ];
    protected $_validate = [
        ["id", "require", "ID必须填写!"],
        ["order_id", "require", "订单ID必须填写!"],
        ["buyer_content", "require", "用户补充内容必须填写!"],
        ["seller_content", "require", "旅社补充内容必须填写!"],
        ["buyer_contract_state", "require", "用户签署情况必须填写!"],
        ["buyer_contract_time", "require", "用户签署时间必须填写!"],
        ["seller_contract_state", "require", "旅社签署情况必须填写!"],
        ["seller_contract_time", "require", "旅社签署时间必须填写!"],
        ["create_time", "require", "创建时间必须填写!"],
        ["update_time", "require", "更新时间必须填写!"],
    ];
    public $excel = false;
    public $delete = false;
    public $fieldMap = [
        "id"=>[
            "type"=>"input",
            "name"=>"ID",
            "lists"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "order_type"=>[
            "type"=>"input",
            "name"=>"订单类型",
            "lists"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>false,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "order_id"=>[
            "type"=>"input",
            "name"=>"订单ID",
            "lists"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>false,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "buyer_content"=>[
            "type"=>"ueditor",
            "name"=>"用户补充内容",
            "lists"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>'
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="buyer_contract_content"> 用户补充合同 </label>
                <div class="col-xs-12 col-sm-6">
                    <div class="panel panel-default">
                      <div class="panel-body">
                            {$model["buyer_content"]|html_entity_decode}
                      </div>
                    </div>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>
            </div>
            ',
            "detail_specify"=>"",
        ],
        "seller_content"=>[
            "type"=>"ueditor",
            "name"=>"旅社补充内容",
            "lists"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>'
            <if condition="($model[\'seller_contract_state\'] eq \'已签署\') AND ($model[\'buyer_contract_state\'] eq \'已签署\')">
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="seller_content"> 旅社补充合同 </label>
                <div class="col-xs-12 col-sm-6">
                    <div class="panel panel-default">
                      <div class="panel-body">
                            {$model["seller_content"]|html_entity_decode}
                      </div>
                    </div>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>
            </div>
            <else/>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="seller_content"> 旅社补充合同 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <textarea class="col-xs-12 col-sm-6 width-100" style="padding: 5px 4px;" rows="5" id="seller_content" name="seller_content" placeholder="旅社补充合同" validate-required="required:请填写旅社补充合同" >{$model["seller_content"]|default=\'\'}</textarea>
                        <i class=""></i>
                    </span>
                </div>
                <script type="text/javascript">var editor = UE.getEditor(\'seller_content\');</script>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>
             </div>
            </if>',
            "detail_specify"=>"",
        ],
        "buyer_contract_state"=>[
            "type"=>"input",
            "name"=>"用户签署情况",
            "lists"=>true,
            "search"=>false,
            "input"=>'create',
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"未签署,已签署",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "buyer_contract_time"=>[
            "type"=>"datetime",
            "name"=>"用户签署时间",
            "lists"=>true,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "seller_contract_state"=>[
            "type"=>"select",
            "name"=>"旅社签署情况",
            "lists"=>true,
            "search"=>false,
            "input"=>true,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"未签署,已签署",
            "list_specify"=>"",
            "update_specify"=>'
            <if condition="$model[\'seller_contract_state\'] eq \'已签署\'">
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="seller_contract_state"> 旅社合同签署情况 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <input type="text" class="width-100" id="seller_contract_state" name="seller_contract_state"  value="{$model[\'seller_contract_state\']|default=\'\'}" <if condition="ACTION_NAME eq update">readonly</if>/>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>
             </div>
            <else/>
            <div class="form-group">
                <label class="col-xs-12 col-sm-3 col-md-3 control-label no-padding-right" for="seller_contract_state"> 旅社合同签署情况 </label>
                <div class="col-xs-12 col-sm-6">
                    <span class="block input-icon input-icon-right">
                        <select name="seller_contract_state" id="seller_contract_state" class="width-100" <if condition="ACTION_NAME eq update">readonly</if>>
                             <option value="未签署" <if condition ="$model[\'seller_contract_state\'] eq \'未签署\'"> selected </if> >未签署</option>
                             <option value="已签署" <if condition ="$model[\'seller_contract_state\'] eq \'已签署\'"> selected </if> >已签署</option>
                        </select>
                        <i class=""></i>
                    </span>
                </div>
                <div class="help-block col-xs-12 col-sm-reset inline" style="margin-bottom: 5px;"></div>
             </div>
            </if>',
            "detail_specify"=>"",
        ],
        "seller_contract_time"=>[
            "type"=>"datetime",
            "name"=>"旅社签署时间",
            "lists"=>true,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "create_time"=>[
            "type"=>"datetime",
            "name"=>"创建时间",
            "lists"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
        "update_time"=>[
            "type"=>"datetime",
            "name"=>"更新时间",
            "lists"=>false,
            "search"=>false,
            "input"=>false,
            "required"=>true,
            "detail"=>true,
            "excel"=>true,
            "content"=>"",
            "list_specify"=>"",
            "update_specify"=>"",
            "detail_specify"=>"",
        ],
    ];
}